package com.liantong.client.api.action;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;

import com.liantong.common.po.G3Member;
import com.liantong.service.cms.G3MemberService;
import com.liantong.util.JsonUtil;


public class MemberAction extends AbstractAction {

	private static final long serialVersionUID = 1L;
	
	@Resource(name="g3MemberService")
	private G3MemberService g3MemberService;
	
	@Action(value = "regist")
	public String registMember(){
		String retval="{" 
					+"\"rst\":\"ok\"," 
					+"\"req_method\":\"member_register\"," 
					+"\"data\":{\"result\":\"郭美美\"}}";
		String memberJson = getPostParamter();
		G3Member g3Member = (G3Member) JsonUtil.getObjectFromJson(memberJson,
				G3Member.class);
		int val = g3MemberService.insertMember(g3Member);
		
		return ajaxJson(retval);
	}	
	
}
